<!-- HTML5文件 -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
		<title>捎品驿站-注册</title>
		<link rel="stylesheet" href="assets/agile/css/agile.layout.css">
		<link rel="stylesheet" href="assets/third/seedsui/plugin/seedsui/seedsui.min.css">
		<link rel="stylesheet" href="css/mystyle.css">
	</head>
	<body>
		<div id="section_container">
			<section id="index_section" data-role="section" class="active">
				<header>
		            <div class="titlebar">
		            	 <a class="left" href="index.html">
		                   <span class="icon icon-arrowleft"></span>
		                </a>
		                <h1 class="text-center">注册</h1>
<!-- 		                <a class="right"  href="reg.html">
		                   注册
		                </a> -->
		            </div>
		        </header>
				<article data-role="article" id="index_article" class="active">
					<div class="scroller">
						<form class=" loginbox" id="form1" method="post" onSubmit="return false" >
							<div class="input-box hasbtn">
								<span class="user glyphicon icon-pad-fill"></span>
								  <input name="phone" type="text" data-rule="required phone" placeholder="请输入手机号"  maxlength="11">
								  <button class="button" id="getcode"><label>获取验证码</label></button>
							</div>
						</form>
						<form class="regbox loginbox" id="form2" method="post" onSubmit="return checkForm(this)" action="home.html">
							<input type="hidden" name="phone">
							<div class="input-box">
								<span class="user glyphicon icon-lock-fill"></span>
								  <input name="key" type="text" data-rule="required minlength:4" placeholder="请输入验证码"  maxlength="11">
							</div>							
							<div class="input-box" data-input='reveal'>
								<span class="password glyphicon icon-lock2-fill"></span>
								  <input name="password" type="password" data-rule="required minlength:6" placeholder="6-32位密码" maxlength="32">
								  <i class="icon  icon-eye-fill"></i>
							</div>
							<div class="btnbar">
								<button class="button radius4 submit block">
	 							    <label>提交</label>
								</button>								
							</div>
							<div class="link">
								<label>点击提交，表示同意<a href="lostpsword.html" ><<捎品驿站用户协议>></a></label>
							</div>
						</form>



					</div>	
				</article>
				

				
			</section>
		</div>
		
		<!--- third -->
		<script src="assets/third/zepto/zepto.min.js"></script>
		<script src="assets/third/iscroll/iscroll-probe.js"></script>
		<!---  agile -->
		<script type="text/javascript" src="assets/agile/js/agile.js"></script>		
<!-- 		<script type="text/javascript" src="assets/bridge/exmobi.js"></script>
		<script type="text/javascript" src="assets/bridge/agile.exmobi.js"></script> -->		
		<!-- app -->
		<script type="text/javascript" src="assets/third/seedsui/plugin/seedsui/seedsui.min.js"></script>
		<script type="text/javascript" src="js/c.js"></script>
		<script type="text/javascript" src="js/u.js"></script>		
		<script>

			A.launch({
			    readyEvent: 'ready'
			});
   			$(window).on('agileready',function(){
   				pageinit('#index_article');
   				$('#getcode').on('tap',function(){
   					if($(this).hasClass('disable')){
   						return;
   					}
   					var that=this;
   					var f=new Form('#form1');
   					if(!f.validate()){

   						return
   					}

   					$(that).addClass('disable')

   					var data={phone:$('#form1').find('[name=phone]').val()}
   					var url='';//getCode api
   					AjaxPost(url,data,function(res){
   						if(res){
   							waitting(that,120);
   							$('#form2 [name=phone]').val(data.phone);
   						}else{
   							$(that).removeClass('disable');//提交失败 放开button禁用
   						}
   					})

   				})	

 
   			});
   			function checkForm(obj){
   				if(obj.id==null||obj.id==''){
   					return false
   				}
   				var f=new Form('#'+obj.id);
   				return f.validate();

   			}
   			function waitting(btn,time){
   				if(time<=0){
   					$(btn).removeClass('disable').find('label').text('获取验证码');
   				}else{
   					$(btn).find('label').text(time+'秒');
   					time=time-1;
   					setTimeout(function(){
   						waitting(btn,time);
   					},1000)
   				}
   			}
		</script>
	</body>
</html>